package com.tc.vms.exception;

/**
 * Created by yonghua.zhang on 2015/12/1.
 */
public class VmsClientException extends Exception {
    private final int errorCode;
    private final String errMsg;

    public VmsClientException(String message) {
        super(message);
        this.errorCode = VmsClientErrorCode.VMS_SYS_ERR_DEFAULT;
        this.errMsg = message;
    }

    public VmsClientException(String message, Throwable cause) {
        super(message, cause);
        this.errorCode = VmsClientErrorCode.VMS_SYS_ERR_DEFAULT;
        this.errMsg = message;
    }

    public VmsClientException(String message, int errorCode) {
        super(message);
        this.errorCode = errorCode;
        this.errMsg = message;
    }

    public VmsClientException(String message, int errorCode, Throwable cause) {
        super(message, cause);
        this.errorCode = errorCode;
        this.errMsg = message;
    }

    public int getErrorCode() {
        return errorCode;
    }

    public String getErrMsg() {
        return errMsg;
    }

    @Override
    public String toString() {
        return "VmsClientException{"
                + "errorCode=" + errorCode
                + ", errMsg=" + errMsg
                + ", originException="
                + super.toString() + "}";
    }
}
